<?php
require_once('ly_check.php');
@header('Content-type: text/html;charset=UTF-8');
?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>上报数据明细</title>
    <link rel="stylesheet" href="../images/css.css" type="text/css"/>
    <style>
        .btn {
            BORDER-RIGHT: #000000 1px solid;
            BORDER-TOP: 1px solid;
            FONT-SIZE: 9pt;
            BORDER-LEFT: #000000 1px solid;
            WIDTH: 40pt;
            BORDER-BOTTOM: #000000 1px solid;
            HEIGHT: 16pt;
            BACKGROUND-COLOR: #e7e7e7;
            cursor: hand;
        }
    </style>
</head>
<body>

<table width="100%" border="0" cellpadding="5" cellspacing="0" class="table">
    <tr>
        <td class="bg_tr">上报数据明细</td>
        <td class="bg_tr" style="width:80%;text-align:right;">
            <span><a href="#" onclick="javascript:history.back();">返回</a></span></td>
    </tr>
</table>
<?php
$sql = "SELECT * from reportrecord where 1=1 ";
$userId = $_GET['servicecode'];
$uploaddate = $_GET['uploaddate'];
if ($userId == '' || $uploaddate == '') {
    echo "<script>window.close();</script>";
}
$sql = $sql . " and code='$userId' and upLoadDate = '$uploaddate'";
$rs = mysql_query($sql);
?>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="td_bgf">
    <thead>
    <tr>
        <th style="width:7%;">企业编码</th>
        <th style="width:7%;">企业名称</th>
        <th style="width:7%;">站点编码</th>
        <th style="width:10%;">站点名称</th>
        <th style="width:7%;">站点类型</th>
        <th style="width:10%;">上报日期</th>
        <th style="width:20%;">代卖商品</th>
        <th style="width:6%;">代卖总订单数</th>
        <th style="width:20%;">代买商品</th>
        <th style="width:6%;">代买总订单数</th>
    </tr>
    </thead>
    <tbody>
    <?php
    $buy = "";
    $sell = "";
    $i = 0;
    $j = 0;
    while ($rows = mysql_fetch_assoc($rs)) {
        $userId = $rows["userId"];
        $userName = $rows["userName"];
        $code = $rows["code"];
        $name = $rows["name"];
        $countyTypeName = $rows["countyTypeName"];
        $upLoadDate = $rows["upLoadDate"];
        if ($rows['goodType']=='B'){
            $buy = $buy . $rows['goodName'] . " : " . $rows['moneyCount'] . "<br />";
            $j++;
        }
        if ($rows['goodType']=='S'){
            $sell = $sell . $rows['goodName'] . " : " . $rows['moneyCount'] . "<br />";
            $i++;
        }
    }
    ?>
    <tr>
        <td class="td_bg" align="center"><?php echo $userId ?></td>
        <td class="td_bg" align="center"><?php echo $userName ?></td>
        <td class="td_bg" align="center"><?php echo $code ?></td>
        <td class="td_bg" align="center"><?php echo $name ?></td>
        <td class="td_bg" align="center"><?php echo $countyTypeName ?></td>
        <td class="td_bg" align="center"><?php echo $upLoadDate ?></td>
        <td class="td_bg" align="center"><?php echo $sell ?></td>
        <td class="td_bg" align="center"><?php echo $i ?></td>
        <td class="td_bg" align="center"><?php echo $buy ?></td>
        <td class="td_bg" align="center"><?php echo $j ?></td>
    </tr>
    </tbody>
</table>
</body>
</html>
